using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Objects;
using BAL;
using System.Collections.Generic;

public partial class Admin_UCControls_UCKhachHang_NhanThe : System.Web.UI.UserControl
{
    public DanhSachKhachHang ItemDanhSachKhachHang;
    public static List<ThongTinGiaoTheTaiNha> ListDanhSachTheMua;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ItemDanhSachKhachHang = new DanhSachKhachHang();
            ItemDanhSachKhachHang = (DanhSachKhachHang)Session["ItemKhachHang"];

            if (ItemDanhSachKhachHang != null)
            {
                GetDanhSachGiaoThe(ItemDanhSachKhachHang.Id,  Convert.ToDateTime(ItemDanhSachKhachHang.NgayDangKy));
            }     
        }
    }


    private void GetDanhSachGiaoThe(int idKhachHang,DateTime ngayDangKy )
    {
        ListDanhSachTheMua = BALThongTinGiaoTheTaiNha.GetAllItem( idKhachHang,ngayDangKy);

        if (ListDanhSachTheMua.Count > 0)
        {
            GridGiaoThe.DataSource = ListDanhSachTheMua;

        }
        GridGiaoThe.PageIndex = 0;
        GridGiaoThe.DataBind();

    }

    //protected void GridGiaoThe_PageIndexChanging(object sender, GridViewPageEventArgs e)
    //{
    //    GridGiaoThe.DataSource = ListDanhSachTheMua;
    //    GridGiaoThe.PageIndex = e.NewPageIndex;
    //    GridGiaoThe.DataBind();
    //}
   
}
